/*    */ package com.zimbra.cs.datasource.imap;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.Message;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ final class MessageChange
/*    */ {
/*    */   private final Type type;
/*    */   private final int itemId;
/*    */   private final Message msg;
/*    */   private final ImapMessage tracker;
/*    */   
/*    */   public static enum Type
/*    */   {
/* 23 */     ADDED,  UPDATED,  MOVED,  DELETED;
/*    */     
/*    */ 
/*    */     private Type() {}
/*    */   }
/*    */   
/*    */ 
/*    */   public static MessageChange added(Message msg)
/*    */   {
/* 32 */     return new MessageChange(Type.ADDED, msg.getId(), msg, null);
/*    */   }
/*    */   
/*    */   public static MessageChange updated(Message msg, ImapMessage tracker) {
/* 36 */     return new MessageChange(Type.UPDATED, msg.getId(), msg, tracker);
/*    */   }
/*    */   
/*    */   public static MessageChange moved(Message msg, ImapMessage tracker) {
/* 40 */     return new MessageChange(Type.MOVED, msg.getId(), msg, tracker);
/*    */   }
/*    */   
/*    */   public static MessageChange deleted(int itemId, ImapMessage tracker) {
/* 44 */     return new MessageChange(Type.DELETED, itemId, null, tracker);
/*    */   }
/*    */   
/*    */   MessageChange(Type type, int itemId, Message msg, ImapMessage tracker) {
/* 48 */     this.type = type;
/* 49 */     this.itemId = itemId;
/* 50 */     this.msg = msg;
/* 51 */     this.tracker = tracker;
/*    */   }
/*    */   
/*    */   public Type getType() {
/* 55 */     return this.type;
/*    */   }
/*    */   
/*    */   public int getItemId() {
/* 59 */     return this.itemId;
/*    */   }
/*    */   
/*    */   public Message getMessage() {
/* 63 */     return this.msg;
/*    */   }
/*    */   
/*    */   public ImapMessage getTracker() {
/* 67 */     return this.tracker;
/*    */   }
/*    */   
/*    */   public boolean isAdded() {
/* 71 */     return this.type == Type.ADDED;
/*    */   }
/*    */   
/*    */   public boolean isUpdated() {
/* 75 */     return this.type == Type.UPDATED;
/*    */   }
/*    */   
/*    */   public boolean isMoved() {
/* 79 */     return this.type == Type.MOVED;
/*    */   }
/*    */   
/*    */   public boolean isDeleted() {
/* 83 */     return this.type == Type.DELETED;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/datasource/imap/MessageChange.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */